﻿using System;
using System.Collections.Generic;
using System.Text;

namespace KaiXin001er.Logic
{
    public class EventProvider
    {
        public delegate void MsgDelegate(object o, EventArgs e);
        public event MsgDelegate OnMsg;
        public void RaiseMsg(string msg)
        {
                MessageEventArgs message = new MessageEventArgs(msg);
                RaiseMsg(this, message);
                
        }
        public void RaiseMsg(object o, EventArgs e)
        {
            if (this.OnMsg != null)
            {
                OnMsg(o, e);
            }
        }
        
    }
    public class MessageEventArgs:EventArgs
    {
        string msg = "";
        public MessageEventArgs(string m)
        {
            msg = m;
        }
        public override string ToString()
        {
            return msg;
        }
    }
}
